package net.valerijtimakov.homefinances.domain.common;


public class CathegoryItem extends OwnedNamedtem {

	private static final long serialVersionUID = 1L;
	public static final long ROOT_CATH_SUPER_ID = -1; 

	private long superId = ROOT_CATH_SUPER_ID;
	private CathegoryType type = CathegoryType.undefined;

	public CathegoryItem() {
		super();
	}
	
	public CathegoryItem(long id, String name, long userId, long superId) {
		super(id, name, userId);
		this.superId = superId;
	}

	public long getSuperId() {
		return superId;
	}

	public void setSuperId(long superId) {
		this.superId = superId;
	}

	public CathegoryType getType() {
		return type;
	}

	public void setType(CathegoryType type) {
		this.type = CathegoryType.checkNull(type);
	}

	@Override
	public String toString() {
		return "superId=" + superId + "," + "type=" + type + "," + super.toString();
	}
}
